package club.twelveblog.tblog.dao;

import club.twelveblog.tblog.entity.Category;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface CategoryDao extends JpaRepository<Category,Long> {

    @Query(value = "SELECT * FROM tb_category WHERE category_name=?1",nativeQuery = true)
    Category findByCategoryName(String categoryName);
}
